

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>监视器配置参考 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="通过 DNS 查询监视器" href="../mon-lookup-dns/" />
    <link rel="prev" title="Cephx 配置参考" href="../auth-config-ref/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../">Ceph 存储集群</a></li>
          <li class="breadcrumb-item"><a href="../">配置</a></li>
      <li class="breadcrumb-item active">监视器配置参考</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/rados/configuration/mon-config-ref.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../">配置</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../storage-devices/">存储设备</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-conf/">配置 Ceph</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/">通用选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-network-config">网络</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#id3">监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-osd-config">认证</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#osds">OSDs</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#id5">心跳</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-logging-and-debugging">日志记录、调试</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-conf">ceph.conf 实例</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-runtime-config">跑多个集群（已废弃）</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network-config-ref/">网络选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../msgr2/">信使协议 v2</a></li>
<li class="toctree-l3"><a class="reference internal" href="../auth-config-ref/">认证选项</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">监视器选项</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#index-0">背景</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-5">监视器的配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="#pool-settings">存储池选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id17">杂项</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../mon-lookup-dns/">通过 DNS 查询监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mon-osd-interaction/">心跳选项（监视器与 OSD 的的交互）</a></li>
<li class="toctree-l3"><a class="reference internal" href="../osd-config-ref/">OSD 选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mclock-config-ref/">DmClock 配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../bluestore-config-ref/">BlueStore 配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../filestore-config-ref/">FileStore 配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../journal-ref/">日志选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../pool-pg-config-ref/">存储池、归置组和 CRUSH 选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../general-config-ref/">常规选项</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../operations/">运维</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/">    手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="monitor-config-reference">
<span id="id1"></span><h1>监视器配置参考<a class="headerlink" href="#monitor-config-reference" title="Permalink to this heading"></a></h1>
<p>理解如何配置 <a class="reference internal" href="../../../glossary/#term-14"><span class="xref std std-term">Ceph 监视器</span></a>是构建可靠的
<a class="reference internal" href="../../../glossary/#term-28"><span class="xref std std-term">Ceph 存储集群</span></a>的重要方面，<strong>任何 Ceph 集群都需要至少一个监视器</strong>。一个监视器通常相当一致，但是你可以增加、删除、或替换集群中的监视器，详情见<a class="reference external" href="../../operations/add-or-rm-mons">增加/删除监视器</a>。</p>
<section id="index-0">
<span id="id2"></span><h2>背景<a class="headerlink" href="#index-0" title="Permalink to this heading"></a></h2>
<p>Ceph 监视器们维护着<a class="reference internal" href="../../../glossary/#term-32"><span class="xref std std-term">集群运行图</span></a>的“主副本”。</p>
<p><a class="reference internal" href="../../../glossary/#term-4"><span class="xref std std-term">Ceph 客户端</span></a>只要连到一个 Ceph 监视器并获取一份当前的集群运行图就能确定所有监视器、 OSD 和元数据服务器的位置。
Ceph 客户端读写 OSD 或元数据服务器前，必须先连到一个监视器，用当前的集群运行图副本和 CRUSH 算法，客户端能计算出任何对象的位置，拥有计算对象位置的技能——故此客户端可以直接与 OSD 通讯，
这对 Ceph 的高伸缩性、高性能来说非常重要。更多信息见<a class="reference external" href="../../../architecture#scalability-and-high-availability">伸缩性和高可用性</a>。</p>
<p>监视器的主要角色是维护集群运行图的主副本，它也提供认证和日志记录服务。 Ceph 监视器们把监视器服务的所有更改写入一个单独的 Paxos 例程，然后 Paxos 以键/值方式存储所有变更以实现高度一致性。同步期间， Ceph 监视器能查询集群运行图的近期版本，它们通过操作键/值存储快照和迭代器（用 leveldb ）来进行存储级同步。</p>
<p class="ditaa">
<img src="../../../_images/ditaa-0b302948cea8bd256db191b550473cf52d143131.png"/>
</p>
<section id="index-1">
<span id="id3"></span><h3>集群运行图<a class="headerlink" href="#index-1" title="Permalink to this heading"></a></h3>
<p>集群运行图是多个图的组合，包括监视器图、 OSD 图、
归置组图和元数据服务器图。集群运行图追踪几个重要事件：
哪些进程在集群里（ <code class="docutils literal notranslate"><span class="pre">in</span></code> ）；
哪些进程在集群里（ <code class="docutils literal notranslate"><span class="pre">in</span></code> ）是 <code class="docutils literal notranslate"><span class="pre">up</span></code> 且在运行、
或 <code class="docutils literal notranslate"><span class="pre">down</span></code> ；归置组状态是 <code class="docutils literal notranslate"><span class="pre">active</span></code> 或 <code class="docutils literal notranslate"><span class="pre">inactive</span></code> 、 <code class="docutils literal notranslate"><span class="pre">clean</span></code> 或其他状态；和其他反映当前集群状态的信息，
像总存储容量、和使用量。</p>
<p>当集群状态有明显变更时，如一 OSD 挂了、
一归置组降级了等等，集群运行图会被更新以反映集群当前状态。
另外，监视器也维护着集群的主要状态历史。
监视器图、 OSD 图、归置组图和元数据服务器图各自维护着它们的运行图版本。
我们把各图的版本称为一个 epoch 。</p>
<p>运营集群时，跟踪这些状态是系统管理任务的重要部分。
详情见<a class="reference external" href="../../operations/monitoring">监控集群</a>和<a class="reference external" href="../../operations/monitoring-osd-pg">监控 OSD 和归置组</a>。</p>
</section>
<section id="index-2">
<span id="id4"></span><h3>监视器法定人数<a class="headerlink" href="#index-2" title="Permalink to this heading"></a></h3>
<p>本文配置部分提供了一个简陋的 <a class="reference external" href="../ceph-conf/#monitors">Ceph 配置文件</a>，
它提供了一个监视器用于测试。只用一个监视器集群可以良好地运行，然而<strong>单监视器是一个单故障点</strong>，
生产集群要实现高可用性的话得配置多个监视器，
这样单个监视器的失效才<strong>不会</strong>影响整个集群。</p>
<p>集群用多个监视器实现高可用性时，
多个监视器用 <a class="reference external" href="https://en.wikipedia.org/wiki/Paxos_(computer_science)">Paxos</a> 算法对主集群运行图达成一致，
这里的一致要求大多数监视器都在运行且够成法定人数
（如 1 个、 3 之 2 在运行、 5 之 3 、 6 之 4 等等）。</p>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_force_quorum_join">
<span class="sig-name descname"><span class="pre">mon_force_quorum_join</span></span><a class="headerlink" href="#confval-mon_force_quorum_join" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>强制监视器加入法定人数，即使它曾被踢出运行图。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</section>
<section id="index-3">
<span id="id5"></span><h3>一致性<a class="headerlink" href="#index-3" title="Permalink to this heading"></a></h3>
<p>你把监视器加进 Ceph 配置文件时，
得注意一些架构问题， Ceph 发现集群内的其他监视器时对其有着<strong>严格的一致性要求</strong>。
尽管如此， Ceph 客户端和其他 Ceph 守护进程用配置文件发现监视器，监视器却用监视器图（ monmap ）
相互发现而非配置文件。</p>
<p>一个监视器发现集群内的其他监视器时总是参考 monmap 的本地副本，用 monmap 而非 Ceph 配置文件避免了可能损坏集群的错误
（如 <code class="docutils literal notranslate"><span class="pre">ceph.conf</span></code> 中指定地址或端口的拼写错误）。
正因为监视器把 monmap 用于发现、
并共享于客户端和其他 Ceph 守护进程间，
<strong>monmap可严格地保证监视器的一致性是可靠的</strong>。</p>
<p>严格的一致性也适用于 monmap 的更新，
因为关于监视器的任何更新、关于 monmap 的变更都是通过称为 <a class="reference external" href="https://en.wikipedia.org/wiki/Paxos_(computer_science)">Paxos</a> 的分布式一致性算法传递的。
监视器们必须就 monmap 的每次更新达成一致，
以确保法定人数里的每个监视器 monmap 版本相同，
如增加、删除一个监视器。 monmap 的更新是增量的，
所以监视器们都有最新的一致版本，以及一系列之前版本。
历史版本的存在允许一个落后的监视器跟上集群当前状态。</p>
<p>如果监视器通过配置文件而非 monmap 相互发现，
这会引进其他风险，因为 Ceph 配置文件不是自动更新并分发的，
监视器有可能不小心用了较老的配置文件，
以致于不认识某监视器、放弃法定人数、或者产生一种 <a class="reference external" href="https://en.wikipedia.org/wiki/Paxos_(computer_science)">Paxos</a> 不能确定当前系统状态的情形。</p>
</section>
<section id="index-4">
<span id="id6"></span><h3>初始化监视器<a class="headerlink" href="#index-4" title="Permalink to this heading"></a></h3>
<p>在大多数配置和部署案例中，部署 Ceph 的工具可以帮你生成一个监视器图来初始化监视器（如 <code class="docutils literal notranslate"><span class="pre">cephadm</span></code> 等），
一个监视器需要 4 个选项：</p>
<ul class="simple">
<li><p><strong>文件系统标识符：</strong> <code class="docutils literal notranslate"><span class="pre">fsid</span></code> 是对象存储的唯一标识符。
因为你可以在一套硬件上运行多个集群，
所以在初始化监视器时必须指定对象存储的唯一标识符。
部署工具通常可替你完成（如 <code class="docutils literal notranslate"><span class="pre">cephadm</span></code> 会调用类似 <code class="docutils literal notranslate"><span class="pre">uuidgen</span></code> 的程序），但是你也可以手动指定 <code class="docutils literal notranslate"><span class="pre">fsid</span></code> 。</p></li>
<li><p><strong>监视器标识符：</strong> 监视器标识符是分配给集群内各监视器的唯一 ID ，它是一个字母数字组合，
为方便起见，标识符通常以字母顺序结尾
（如 <code class="docutils literal notranslate"><span class="pre">a</span></code> 、 <code class="docutils literal notranslate"><span class="pre">b</span></code> 等等），可以设置于 Ceph 配置文件
（如 <code class="docutils literal notranslate"><span class="pre">[mon.a]</span></code> 、 <code class="docutils literal notranslate"><span class="pre">[mon.b]</span></code> 等等）、部署工具、
或 <code class="docutils literal notranslate"><span class="pre">ceph</span></code> 命令行工具。</p></li>
<li><p><strong>密钥：</strong> 监视器必须有密钥。像 <code class="docutils literal notranslate"><span class="pre">cephadm</span></code>
这样的部署工具通常会自动生成，也可以手动完成。
见<a class="reference external" href="../../../dev/mon-bootstrap#secret-keys">监视器密钥环</a>。</p></li>
</ul>
<p>关于初始化的具体信息见<a class="reference external" href="../../../dev/mon-bootstrap">初始化监视器</a>。</p>
</section>
</section>
<section id="index-5">
<span id="id7"></span><h2>监视器的配置<a class="headerlink" href="#index-5" title="Permalink to this heading"></a></h2>
<p>要把配置应用到整个集群，把它们放到 <code class="docutils literal notranslate"><span class="pre">[global]</span></code> 下；
要用于所有监视器，置于 <code class="docutils literal notranslate"><span class="pre">[mon]</span></code> 下；
要用于某监视器，指定监视器例程，如 <code class="docutils literal notranslate"><span class="pre">[mon.a]</span></code> ）。按惯例，监视器例程用字母命名。</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[global]</span>

<span class="k">[mon]</span>

<span class="k">[mon.a]</span>

<span class="k">[mon.b]</span>

<span class="k">[mon.c]</span>
</pre></div>
</div>
<section id="id8">
<h3>最小配置<a class="headerlink" href="#id8" title="Permalink to this heading"></a></h3>
<p>Ceph 监视器的最简配置必须包括一主机名及其监视器地址，
这些配置可置于 <code class="docutils literal notranslate"><span class="pre">[mon]</span></code> 下或某个监视器下。</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[mon]</span>
<span class="w">        </span><span class="na">mon host</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">hostname1,hostname2,hostname3</span>
<span class="w">        </span><span class="na">mon addr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">10.0.0.10:6789,10.0.0.11:6789,10.0.0.12:6789</span>
</pre></div>
</div>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[mon.a]</span>
<span class="w">        </span><span class="na">host</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">hostname1</span>
<span class="w">        </span><span class="na">mon addr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">10.0.0.10:6789</span>
</pre></div>
</div>
<p>详情见<a class="reference external" href="../network-config-ref">网络配置参考</a>。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>这里的监视器最简配置假设部署工具会自动给你生成
<code class="docutils literal notranslate"><span class="pre">fsid</span></code> 和 <code class="docutils literal notranslate"><span class="pre">mon.</span></code> 密钥。</p>
</div>
<p>一旦部署完 Ceph 集群，监视器 IP 地址就<strong>不应该</strong>更改了。然而，如果你决意要改，必须严格遵循特定的步骤，
详情见<a class="reference internal" href="../../operations/add-or-rm-mons/#ip"><span class="std std-ref">更改监视器的 IP 地址</span></a>。</p>
<p>也可以让客户端通过 DNS 的 SRV 记录发现监视器，
详情见<a class="reference external" href="../mon-lookup-dns">通过 DNS 查询监视器</a>。</p>
</section>
<section id="id">
<h3>集群 ID<a class="headerlink" href="#id" title="Permalink to this heading"></a></h3>
<p>每个 Ceph 存储集群都有一个唯一标识符（ <code class="docutils literal notranslate"><span class="pre">fsid</span></code> ）。如果指定了，它应该出现在配置文件的 <code class="docutils literal notranslate"><span class="pre">[global]</span></code> 段下。部署工具通常会生成 <code class="docutils literal notranslate"><span class="pre">fsid</span></code> 并存于监视器图，所以不一定会写入配置文件，<code class="docutils literal notranslate"><span class="pre">fsid</span></code> 使得在一套硬件上运行多个集群成为可能。</p>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-fsid">
<span class="sig-name descname"><span class="pre">fsid</span></span><a class="headerlink" href="#confval-fsid" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>集群 ID ，一集群一个。 如果没指定，部署工具会生成。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uuid</span></code></p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>如果你用部署工具就不能设置， 因为它会给你设置。</p>
</div>
</div></blockquote>
</dd></dl>

</section>
<section id="index-6">
<span id="id9"></span><h3>初始成员<a class="headerlink" href="#index-6" title="Permalink to this heading"></a></h3>
<p>我们建议在生产环境下最少部署 3 个监视器，以确保高可用性。运行多个监视器时，你可以指定为形成法定人数成员所需的初始监视器，这能减小集群上线时间。</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[mon]</span>
<span class="w">        </span><span class="na">mon_initial_members</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">a,b,c</span>
</pre></div>
</div>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_initial_members">
<span class="sig-name descname"><span class="pre">mon_initial_members</span></span><a class="headerlink" href="#confval-mon_initial_members" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>集群启动时初始监视器的 ID ， 若指定了， Ceph 需要单数个监视器来确定初始法定人数 （如 3 ）。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>集群内的<em>大多数</em>监视器必须能互通才能建立法定人数， 为建立法定人数， 你可以用此选项减小初始监视器数量。</p>
</div>
</div></blockquote>
</dd></dl>

</section>
<section id="index-7">
<span id="id10"></span><h3>数据<a class="headerlink" href="#index-7" title="Permalink to this heading"></a></h3>
<p>Ceph 监视器有存储数据的默认路径。为优化性能，在生产集群上，我们建议在独立主机上运行 Ceph 监视器，不要与运行 Ceph OSD
守护进程的主机混用。因为 leveldb 靠 <code class="docutils literal notranslate"><span class="pre">mmap()</span></code> 写数据， Ceph
监视器会频繁地把数据从内存刷回磁盘，如果其数据与 OSD
守护进程共用存储器，就会与 Ceph OSD 守护进程的载荷冲突。</p>
<p>在 Ceph 0.58 及更早版本中，监视器数据以文件保存，这样人们可以用 <code class="docutils literal notranslate"><span class="pre">ls</span></code> 和 <code class="docutils literal notranslate"><span class="pre">cat</span></code> 这些普通工具检查监视器数据，然而它不能提供健壮的一致性。</p>
<p>在 Ceph 0.59 及后续版本中，监视器以键/值对存储数据。
监视器需要 <a class="reference external" href="https://en.wikipedia.org/wiki/ACID">ACID</a> 事务，数据存储的使用可防止监视器用损坏的版本进行恢复，除此之外，
它允许在一个原子批量操作中进行多个修改操作。</p>
<p>一般来说我们不建议更改默认数据位置，如果要改，我们建议所有监视器统一配置，加到配置文件的 <code class="docutils literal notranslate"><span class="pre">[mon]</span></code> 下。</p>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_data">
<span class="sig-name descname"><span class="pre">mon_data</span></span><a class="headerlink" href="#confval-mon_data" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器的数据位置。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">/var/lib/ceph/mon/$cluster-$id</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_data_size_warn">
<span class="sig-name descname"><span class="pre">mon_data_size_warn</span></span><a class="headerlink" href="#confval-mon_data_size_warn" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>一个监视器的数据量大于此尺寸时触发 <code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> 状态， 默认是 15GB 。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">15Gi</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_data_avail_warn">
<span class="sig-name descname"><span class="pre">mon_data_avail_warn</span></span><a class="headerlink" href="#confval-mon_data_avail_warn" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器的数据存储磁盘可用空间 小于或等于此百分比时 触发 <code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> 状态。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">30</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_data_avail_crit">
<span class="sig-name descname"><span class="pre">mon_data_avail_crit</span></span><a class="headerlink" href="#confval-mon_data_avail_crit" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器的数据存储磁盘可用空间 小于或等于此百分比时 触发 <code class="docutils literal notranslate"><span class="pre">HEALTH_ERR</span></code> 状态。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_warn_on_crush_straw_calc_version_zero">
<span class="sig-name descname"><span class="pre">mon_warn_on_crush_straw_calc_version_zero</span></span><a class="headerlink" href="#confval-mon_warn_on_crush_straw_calc_version_zero" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>如果 CRUSH 的 <code class="docutils literal notranslate"><span class="pre">straw_calc_version</span></code> 值为 0 ，触发 <code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> 状态。 详情见
<a class="reference internal" href="../../operations/crush-map/#crush-map-tunables"><span class="std std-ref">CRUSH 图的可调选项</span></a>。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_warn_on_legacy_crush_tunables">
<span class="sig-name descname"><span class="pre">mon_warn_on_legacy_crush_tunables</span></span><a class="headerlink" href="#confval-mon_warn_on_legacy_crush_tunables" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>如果 CRUSH 可调选项太旧（比 <code class="docutils literal notranslate"><span class="pre">mon_min_crush_required_version</span></code> 旧），触发
<code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> 。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-mon_crush_min_required_version"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_crush_min_required_version</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_crush_min_required_version">
<span class="sig-name descname"><span class="pre">mon_crush_min_required_version</span></span><a class="headerlink" href="#confval-mon_crush_min_required_version" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>此集群要求的最低可调配置版本号， 详情见 <a class="reference internal" href="../../operations/crush-map/#crush-map-tunables"><span class="std std-ref">CRUSH 图的可调选项</span></a>。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">hammer</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-mon_warn_on_legacy_crush_tunables"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_warn_on_legacy_crush_tunables</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_warn_on_osd_down_out_interval_zero">
<span class="sig-name descname"><span class="pre">mon_warn_on_osd_down_out_interval_zero</span></span><a class="headerlink" href="#confval-mon_warn_on_osd_down_out_interval_zero" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>如果 <code class="docutils literal notranslate"><span class="pre">mon_osd_down_out_interval</span></code> 是 0 就触发 <code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> 。 Leader
上的这个选项设置为 0 时，作用类似 <code class="docutils literal notranslate"><span class="pre">noout</span></code> 标记。 集群没有设置 <code class="docutils literal notranslate"><span class="pre">noout</span></code>
标记，而表现出的行为却一样时很难查出为什么， 所以我们对此情况发出警告。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../mon-osd-interaction/#confval-mon_osd_down_out_interval"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_osd_down_out_interval</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_warn_on_slow_ping_ratio">
<span class="sig-name descname"><span class="pre">mon_warn_on_slow_ping_ratio</span></span><a class="headerlink" href="#confval-mon_warn_on_slow_ping_ratio" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Raise <code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> when any heartbeat between OSDs exceeds
<code class="docutils literal notranslate"><span class="pre">mon_warn_on_slow_ping_ratio</span></code> of <code class="docutils literal notranslate"><span class="pre">osd_heartbeat_grace</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.05</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../mon-osd-interaction/#confval-osd_heartbeat_grace"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_heartbeat_grace</span></code></a>, <a class="reference internal" href="#confval-mon_warn_on_slow_ping_time"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_warn_on_slow_ping_time</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_warn_on_slow_ping_time">
<span class="sig-name descname"><span class="pre">mon_warn_on_slow_ping_time</span></span><a class="headerlink" href="#confval-mon_warn_on_slow_ping_time" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Override <code class="docutils literal notranslate"><span class="pre">mon_warn_on_slow_ping_ratio</span></code> with a specific value. Raise
<code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> if any heartbeat between OSDs exceeds
<code class="docutils literal notranslate"><span class="pre">mon_warn_on_slow_ping_time</span></code> milliseconds.  The default is 0
(disabled).</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.0</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-mon_warn_on_slow_ping_ratio"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_warn_on_slow_ping_ratio</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_warn_on_pool_no_redundancy">
<span class="sig-name descname"><span class="pre">mon_warn_on_pool_no_redundancy</span></span><a class="headerlink" href="#confval-mon_warn_on_pool_no_redundancy" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Raise <code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> if any pool is configured with no replicas.</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="../pool-pg-config-ref/#confval-osd_pool_default_size"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_pool_default_size</span></code></a>, <a class="reference internal" href="../pool-pg-config-ref/#confval-osd_pool_default_min_size"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_pool_default_min_size</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_cache_target_full_warn_ratio">
<span class="sig-name descname"><span class="pre">mon_cache_target_full_warn_ratio</span></span><a class="headerlink" href="#confval-mon_cache_target_full_warn_ratio" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>存储池使用率达到 <code class="docutils literal notranslate"><span class="pre">cache_target_full</span></code> 和 <code class="docutils literal notranslate"><span class="pre">target_max_object</span></code> 的多大比例时发出警告。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.66</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_health_to_clog">
<span class="sig-name descname"><span class="pre">mon_health_to_clog</span></span><a class="headerlink" href="#confval-mon_health_to_clog" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>是否周期性地向集群日志发送健康信息摘要。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_health_to_clog_tick_interval">
<span class="sig-name descname"><span class="pre">mon_health_to_clog_tick_interval</span></span><a class="headerlink" href="#confval-mon_health_to_clog_tick_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器向集群日志发送健康信息摘要的频率，单位为秒。 非正数表示禁用此功能。如果当前健康摘要为空或者与上次的相同， 监视器就不会发给
集群日志了。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span> <span class="pre">minute</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_health_to_clog_interval">
<span class="sig-name descname"><span class="pre">mon_health_to_clog_interval</span></span><a class="headerlink" href="#confval-mon_health_to_clog_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器向集群日志发送健康摘要的频率，单位为秒。 非正数表示禁用此功能。 不管和前面的摘要相比有没有变化， 监视器都会把摘要发给集群日志。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10</span> <span class="pre">minutes</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-mon_health_to_clog"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_health_to_clog</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</section>
<section id="storage-capacity">
<span id="index-8"></span><span id="id11"></span><h3>存储容量<a class="headerlink" href="#storage-capacity" title="Permalink to this heading"></a></h3>
<p>Ceph 存储集群利用率接近最大容量时（即 <code class="docutils literal notranslate"><span class="pre">mon</span> <span class="pre">osd</span> <span class="pre">full</span> <span class="pre">ratio</span></code> ），作为防止数据丢失的安全措施，它会阻止你读写 OSD 。
因此，让生产集群用满可不是好事，因为牺牲了高可用性。
full ratio 默认值是 <code class="docutils literal notranslate"><span class="pre">.95</span></code> 或容量的 95% 。
对小型测试集群来说这是非常激进的设置。</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>监控集群时，要警惕和 <code class="docutils literal notranslate"><span class="pre">nearfull</span></code> 相关的警告。
这意味着一些 OSD 的失败会导致临时服务中断，
应该增加一些 OSD 来扩展存储容量。</p>
</div>
<p>在测试集群时，一个常见场景是：
系统管理员从集群删除一个 OSD 、接着观察重均衡；然后继续删除其他 OSD ，
直到集群达到占满率并锁死。我们建议，
即使在测试集群里也要规划一点空闲容量用于保证高可用性。
理想情况下，要做好这样的预案：一系列 OSD 失败后，短时间内不更换它们仍能恢复到 <code class="docutils literal notranslate"><span class="pre">active</span> <span class="pre">+</span> <span class="pre">clean</span></code> 状态。
你也可以在 <code class="docutils literal notranslate"><span class="pre">active</span> <span class="pre">+</span> <span class="pre">degraded</span></code> 状态运行集群，
但对正常使用来说并不好。</p>
<p>下图描述了一个简化的 Ceph 集群，它包含 33 个节点、
每主机一个 OSD 、每 OSD 3TB 容量，
所以这个小白鼠集群有 99TB 的实际容量，
其 <code class="docutils literal notranslate"><span class="pre">mon</span> <span class="pre">osd</span> <span class="pre">full</span> <span class="pre">ratio</span></code> 为 <code class="docutils literal notranslate"><span class="pre">.95</span></code> 。
如果它只剩余 5TB 容量，集群就不允许客户端再读写数据，
所以它的运行容量是 95TB ，而非 99TB 。</p>
<p class="ditaa">
<img src="../../../_images/ditaa-2e42aaba27b9f97d6032bf0694ef7ba0e5b413ce.png"/>
</p>
<p>在这样的集群里，坏一或两个 OSD 很平常；
一种罕见但可能发生的情形是一个机架的路由器或电源挂了，
这会导致多个 OSD 同时离线（如 OSD 7-12 ），
在这种情况下，你仍要力争保持集群可运行并达到 <code class="docutils literal notranslate"><span class="pre">active</span> <span class="pre">+</span> <span class="pre">clean</span></code> 状态，
即使这意味着你得在短期内额外增加一些 OSD 及主机。
如果集群利用率太高，在解决故障域期间也许不会丢数据，
但很可能牺牲数据可用性，因为利用率超过了 full ratio 。故此，我们建议至少要粗略地规划下容量。</p>
<p>找出你集群的两个数量：</p>
<ol class="arabic simple">
<li><p>OSD 数量。</p></li>
<li><p>集群总容量。</p></li>
</ol>
<p>用集群里 OSD 总数除以集群总容量，
就能得到 OSD 平均容量；
如果按预计的 OSD 数乘以这个值所得的结果计算（偏小），
实际应用时将出错；
最后再用集群容量乘以占满率能得到最大运行容量，
然后，扣除预估的 OSD 失败率；
用较高的失败率（如整机架的 OSD ）
重复前述过程看是否接近占满率。</p>
<p>下列配置仅在创建集群时有效，之后就存储在 OSDMap 里。
要说明的是，在日常操作中，
OSD 们使用的数值是 OSDMap 里的，
不是配置文件或中央配置库里的。</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[global]</span>

<span class="w">        </span><span class="na">mon_osd_full_ratio</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">.80</span>
<span class="w">        </span><span class="na">mon_osd_backfillfull_ratio</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">.75</span>
<span class="w">        </span><span class="na">mon_osd_nearfull_ratio</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">.70</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">mon_osd_full_ratio</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述<span class="colon">:</span></dt>
<dd class="field-odd"><p>OSD 硬盘使用率达到多少就认为它 <code class="docutils literal notranslate"><span class="pre">full</span></code> 。</p>
</dd>
<dt class="field-even">类型<span class="colon">:</span></dt>
<dd class="field-even"><p>Float</p>
</dd>
<dt class="field-odd">默认值<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">.95</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">mon_osd_backfillfull_ratio</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述<span class="colon">:</span></dt>
<dd class="field-odd"><p>OSD 磁盘空间利用率达到多少就认为它太满了，
不能再接受回填。</p>
</dd>
<dt class="field-even">类型<span class="colon">:</span></dt>
<dd class="field-even"><p>Float</p>
</dd>
<dt class="field-odd">默认值<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">.90</span></code></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">mon_osd_nearfull_ratio</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述<span class="colon">:</span></dt>
<dd class="field-odd"><p>OSD 硬盘使用率达到多少就认为它 <code class="docutils literal notranslate"><span class="pre">nearfull</span></code> 。</p>
</dd>
<dt class="field-even">类型<span class="colon">:</span></dt>
<dd class="field-even"><p>Float</p>
</dd>
<dt class="field-odd">默认值<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">.85</span></code></p>
</dd>
</dl>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>如果一些 OSD 快满了，但其他的仍有足够空间，
你可能配错 CRUSH 权重了。</p>
</div>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>这些配置仅在创建集群时有效。
之后要改它们就在 OSDMap 里了，
可以用 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">osd</span> <span class="pre">set-nearfull-ratio</span></code> 和
<code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">osd</span> <span class="pre">set-full-ratio</span></code> 。</p>
</div>
</section>
<section id="index-9">
<span id="id12"></span><h3>心跳<a class="headerlink" href="#index-9" title="Permalink to this heading"></a></h3>
<p>Ceph 监视器要求各 OSD 向它报告、
并接收 OSD 们的邻居状态报告，以此来掌握集群。 Ceph 提供了监视器与 OSD 交互的合理默认值，然而你可以按需修改，详情见<a class="reference external" href="../mon-osd-interaction">监视器与 OSD 的交互</a>。</p>
</section>
<section id="index-10">
<span id="id13"></span><h3>监视器存储同步<a class="headerlink" href="#index-10" title="Permalink to this heading"></a></h3>
<p>当你用多个监视器（建议的）支撑一个生产集群时，
各监视器都要检查邻居是否有集群运行图的最新版本
（如，邻居监视器的图有一或多个 epoch 版本高于当前监视器的最高版 epoch ），
过一段时间，集群里的某个监视器可能落后于其它监视器太多而不得不离开法定人数，
然后同步到集群当前状态，并重回法定人数。
为了同步，监视器可能承担三种中的一种角色：</p>
<ol class="arabic simple">
<li><p><strong>Leader</strong>: <cite>Leader</cite> 是实现最新 Paxos 版本的第一个监视器。</p></li>
<li><p><strong>Provider</strong>: <cite>Provider</cite> 有最新集群运行图的监视器，
但不是第一个实现最新版。</p></li>
<li><p><strong>Requester:</strong> <cite>Requester</cite> 落后于 leader ，
重回法定人数前，必须同步以获取关于集群的最新信息。</p></li>
</ol>
<p>有了这些角色区分， leader 就可以给 provider 委派同步任务，这会避免同步请求压垮 leader 、影响性能。
在下面的图示中， requester 已经知道它落后于其它监视器，然后向 leader 请求同步，
leader 让它去和 provider 同步。</p>
<p class="ditaa">
<img src="../../../_images/ditaa-f13d9d9ecfaf9cb774d8d952e40c240b5bb03070.png"/>
</p>
<p>新监视器加入集群时有必要进行同步。在运行中，监视器会不定时收到集群运行图的更新，这就意味着 leader 和 provider 角色可能在监视器间变幻。
如果这事发生在同步期间（如 provider 落后于 leader ），
provider 能终结和 requester 间的同步。</p>
<p>一旦同步完成， Ceph 需要修复整个集群，
使归置组回到 <code class="docutils literal notranslate"><span class="pre">active</span> <span class="pre">+</span> <span class="pre">clean</span></code> 状态。</p>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_sync_timeout">
<span class="sig-name descname"><span class="pre">mon_sync_timeout</span></span><a class="headerlink" href="#confval-mon_sync_timeout" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器与它的上家同步的时候，等待下一个更新消息的时长 （单位为秒），超时此时间就放弃， 然后从头再进行自举引导。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span> <span class="pre">minute</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_sync_max_payload_size">
<span class="sig-name descname"><span class="pre">mon_sync_max_payload_size</span></span><a class="headerlink" href="#confval-mon_sync_max_payload_size" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>一个同步载荷的最大尺寸（单位为字节）。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1Mi</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-paxos_max_join_drift">
<span class="sig-name descname"><span class="pre">paxos_max_join_drift</span></span><a class="headerlink" href="#confval-paxos_max_join_drift" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>允许的最大 Paxos 迭代量， 超过此值必须先同步监视器数据。 当某个监视器发现别的互联点比它领先太多的时候，
它得先同步数据才能继续工作。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-paxos_stash_full_interval">
<span class="sig-name descname"><span class="pre">paxos_stash_full_interval</span></span><a class="headerlink" href="#confval-paxos_stash_full_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>多久（按提交数量计算）存储一份完整的 PaxosService 状态。 当前这个选项会影响 <code class="docutils literal notranslate"><span class="pre">mds</span></code> 、 <code class="docutils literal notranslate"><span class="pre">mon</span></code> 、
<code class="docutils literal notranslate"><span class="pre">auth</span></code> 和 <code class="docutils literal notranslate"><span class="pre">mgr</span></code> 的 PaxosService 。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">25</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-paxos_propose_interval">
<span class="sig-name descname"><span class="pre">paxos_propose_interval</span></span><a class="headerlink" href="#confval-paxos_propose_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>提议更新之前收集本时间段的更新。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-paxos_min">
<span class="sig-name descname"><span class="pre">paxos_min</span></span><a class="headerlink" href="#confval-paxos_min" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>保留着的 paxos 状态的最小数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">500</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-paxos_min_wait">
<span class="sig-name descname"><span class="pre">paxos_min_wait</span></span><a class="headerlink" href="#confval-paxos_min_wait" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>经过一段不活跃时间后， 收集更新的最小等待时间。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.05</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-paxos_trim_min">
<span class="sig-name descname"><span class="pre">paxos_trim_min</span></span><a class="headerlink" href="#confval-paxos_trim_min" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>有多少多余的额外提议才能清理。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">250</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-paxos_trim_max">
<span class="sig-name descname"><span class="pre">paxos_trim_max</span></span><a class="headerlink" href="#confval-paxos_trim_max" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>一次最多清理多少额外提议。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">500</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-paxos_service_trim_min">
<span class="sig-name descname"><span class="pre">paxos_service_trim_min</span></span><a class="headerlink" href="#confval-paxos_service_trim_min" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>至少积攒多少个版本再触发清理机制（ 0 禁用此选项）。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">250</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-paxos_service_trim_max">
<span class="sig-name descname"><span class="pre">paxos_service_trim_max</span></span><a class="headerlink" href="#confval-paxos_service_trim_max" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>一次提议最多可以清理多少个版本（ 0 禁用此选项）。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">500</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-paxos_service_trim_max_multiplier">
<span class="sig-name descname"><span class="pre">paxos_service_trim_max_multiplier</span></span><a class="headerlink" href="#confval-paxos_service_trim_max_multiplier" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>factor by which paxos_service_trim_max will be multiplied to get a new
upper bound when trim sizes are high  (0 disables it)</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">20</span></code></p>
</dd>
<dt class="field-odd">min<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_mds_force_trim_to">
<span class="sig-name descname"><span class="pre">mon_mds_force_trim_to</span></span><a class="headerlink" href="#confval-mon_mds_force_trim_to" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>强制让监视器把 mdsmap 裁截到这个 FSMap 时间结，不包括这一个。 默认值为 0 ，表示禁用此配置选项。
这个命令有潜在危险，慎用！</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_osd_force_trim_to">
<span class="sig-name descname"><span class="pre">mon_osd_force_trim_to</span></span><a class="headerlink" href="#confval-mon_osd_force_trim_to" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>强制让监视器把 osdmap 裁截到这一点， 即使指定的时间结上仍有不干净的 PG 也在所不惜。 0 禁用此选项。 非常危险，慎用！</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_osd_cache_size">
<span class="sig-name descname"><span class="pre">mon_osd_cache_size</span></span><a class="headerlink" href="#confval-mon_osd_cache_size" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>osdmap 缓存的尺寸，与底层存储的缓存无关。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">500</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_election_timeout">
<span class="sig-name descname"><span class="pre">mon_election_timeout</span></span><a class="headerlink" href="#confval-mon_election_timeout" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>等待大家确认选举提案的最大时长。单位为秒。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_lease">
<span class="sig-name descname"><span class="pre">mon_lease</span></span><a class="headerlink" href="#confval-mon_lease" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器版本租期（秒）。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_lease_renew_interval_factor">
<span class="sig-name descname"><span class="pre">mon_lease_renew_interval_factor</span></span><a class="headerlink" href="#confval-mon_lease_renew_interval_factor" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p><code class="docutils literal notranslate"><span class="pre">mon_lease``_\*_``mon_lease_renew_interval_factor</span></code>
时长就是 Leader （头领）刷新其他监视器租期的间隔。
此系数应该小于 <code class="docutils literal notranslate"><span class="pre">1.0</span></code> 。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.6</span></code></p>
</dd>
<dt class="field-odd">allowed range<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">0.9999999]</span></code></p>
</dd>
<dt class="field-even">see also<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#confval-mon_lease"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_lease</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_lease_ack_timeout_factor">
<span class="sig-name descname"><span class="pre">mon_lease_ack_timeout_factor</span></span><a class="headerlink" href="#confval-mon_lease_ack_timeout_factor" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Leader 会等着各 Provider 确认租期延续， 时间不超过 <code class="docutils literal notranslate"><span class="pre">mon</span> <span class="pre">lease</span></code> * <code class="docutils literal notranslate"><span class="pre">mon</span> <span class="pre">lease</span> <span class="pre">ack</span>
<span class="pre">timeout</span> <span class="pre">factor</span></code> 。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">2.0</span></code></p>
</dd>
<dt class="field-odd">allowed range<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">[1.0001,</span> <span class="pre">100]</span></code></p>
</dd>
<dt class="field-even">see also<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#confval-mon_lease"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_lease</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_accept_timeout_factor">
<span class="sig-name descname"><span class="pre">mon_accept_timeout_factor</span></span><a class="headerlink" href="#confval-mon_accept_timeout_factor" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Leader 会等着 Requester(s) 接收 Paxos 更新， 时间不超过 <code class="docutils literal notranslate"><span class="pre">mon</span> <span class="pre">lease</span></code> * <code class="docutils literal notranslate"><span class="pre">mon</span>
<span class="pre">accept</span> <span class="pre">timeout</span> <span class="pre">factor</span></code> 。 出于类似目的，在 Paxos 恢复阶段也会用到此配置。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">2.0</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-mon_lease"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_lease</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_min_osdmap_epochs">
<span class="sig-name descname"><span class="pre">mon_min_osdmap_epochs</span></span><a class="headerlink" href="#confval-mon_min_osdmap_epochs" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>一直保留的 OSD 运行图时间结的最小数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">500</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_max_log_epochs">
<span class="sig-name descname"><span class="pre">mon_max_log_epochs</span></span><a class="headerlink" href="#confval-mon_max_log_epochs" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器应该保留的日志时间结的最大数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">500</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</section>
<section id="mon-config-ref-clock">
<span id="index-11"></span><span id="id14"></span><h3>时钟<a class="headerlink" href="#mon-config-ref-clock" title="Permalink to this heading"></a></h3>
<p>Ceph 的守护进程会相互传递关键消息，
这些消息必须在达到超时阀值前处理掉。
如果 Ceph 监视器时钟不同步，就可能出现多种异常情况。例如：</p>
<ul class="simple">
<li><p>守护进程忽略了收到的消息（如时间戳过时了）</p></li>
<li><p>消息未及时收到时，超时触发得太快或太晚。</p></li>
</ul>
<p>详情见<a class="reference internal" href="#id13">监视器存储同步</a>。</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>你必须在所有监视器主机上安装 NTP 或 PTP 守护进程以确保监视器集群在时钟同步的前提下运行。可以让各个监视器之间相互同步、
也可以和几个高品质的上游时间源同步。</p>
</div>
<p>时钟漂移即使尚未造成损坏也能被 NTP 感知， Ceph 的时钟漂移或时钟偏差警告即使在 NTP 同步水平合理时也会被触发。提高时钟漂移值有时候尚可容忍，然而很多因素（像载荷、网络延时、覆盖默认超时值和<a class="reference internal" href="#id13">监视器存储同步</a>选项）都能在不降低 Paxos 保证级别的情况下影响可接受的时钟漂移水平。</p>
<p>Ceph 提供了下列这些可调选项，让你自己琢磨可接受的值。</p>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_tick_interval">
<span class="sig-name descname"><span class="pre">mon_tick_interval</span></span><a class="headerlink" href="#confval-mon_tick_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器的心跳间隔，单位为秒。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_clock_drift_allowed">
<span class="sig-name descname"><span class="pre">mon_clock_drift_allowed</span></span><a class="headerlink" href="#confval-mon_clock_drift_allowed" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器之间容许的时钟漂移量，单位为秒，超过就发出健康警告。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.05</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_clock_drift_warn_backoff">
<span class="sig-name descname"><span class="pre">mon_clock_drift_warn_backoff</span></span><a class="headerlink" href="#confval-mon_clock_drift_warn_backoff" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>在集群日志里记录时钟偏移警告的指数退避因子。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_timecheck_interval">
<span class="sig-name descname"><span class="pre">mon_timecheck_interval</span></span><a class="headerlink" href="#confval-mon_timecheck_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Leader 的时间检查间隔（时钟漂移检查）， 单位为秒。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span> <span class="pre">minutes</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_timecheck_skew_interval">
<span class="sig-name descname"><span class="pre">mon_timecheck_skew_interval</span></span><a class="headerlink" href="#confval-mon_timecheck_skew_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>时间检查间隔（时钟漂移检查），单位为秒。 出现时间偏差时， Leader 间隔多久检查一次。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">30.0</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-mon_timecheck_interval"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_timecheck_interval</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</section>
<section id="id15">
<h3>客户端<a class="headerlink" href="#id15" title="Permalink to this heading"></a></h3>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_client_hunt_interval">
<span class="sig-name descname"><span class="pre">mon_client_hunt_interval</span></span><a class="headerlink" href="#confval-mon_client_hunt_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>客户端每 <code class="docutils literal notranslate"><span class="pre">N</span></code> 秒尝试一个新监视器， 直到它建立连接。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">3.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_client_ping_interval">
<span class="sig-name descname"><span class="pre">mon_client_ping_interval</span></span><a class="headerlink" href="#confval-mon_client_ping_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>客户端每 <code class="docutils literal notranslate"><span class="pre">N</span></code> 秒 ping 一次监视器。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_client_max_log_entries_per_message">
<span class="sig-name descname"><span class="pre">mon_client_max_log_entries_per_message</span></span><a class="headerlink" href="#confval-mon_client_max_log_entries_per_message" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>一个监视器为每个客户端生成的最大日志条数。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1000</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_client_bytes">
<span class="sig-name descname"><span class="pre">mon_client_bytes</span></span><a class="headerlink" href="#confval-mon_client_bytes" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>内存中允许存留的客户端消息数量（字节数）。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">100Mi</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</section>
</section>
<section id="pool-settings">
<span id="id16"></span><h2>存储池选项<a class="headerlink" href="#pool-settings" title="Permalink to this heading"></a></h2>
<p>从 v0.94 版起，存储池可通过标记来表明这个存储池允许或禁止更改。如果配置得当，监视器也可以禁止存储池的删除。这种防护方式虽有不便，和它防止的存储池（还有数据）误删比起来就差远了。</p>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_allow_pool_delete">
<span class="sig-name descname"><span class="pre">mon_allow_pool_delete</span></span><a class="headerlink" href="#confval-mon_allow_pool_delete" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器是否允许删除存储池，无视存储池标记？</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_ec_fast_read">
<span class="sig-name descname"><span class="pre">osd_pool_default_ec_fast_read</span></span><a class="headerlink" href="#confval-osd_pool_default_ec_fast_read" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Whether to turn on fast read on the pool or not. It will be used as
the default setting of newly created erasure coded pools if
<code class="docutils literal notranslate"><span class="pre">fast_read</span></code> is not specified at create time.</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_flag_hashpspool">
<span class="sig-name descname"><span class="pre">osd_pool_default_flag_hashpspool</span></span><a class="headerlink" href="#confval-osd_pool_default_flag_hashpspool" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>在新存储池上设置 hashpspool 标记（更好的哈希方案）</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_flag_nodelete">
<span class="sig-name descname"><span class="pre">osd_pool_default_flag_nodelete</span></span><a class="headerlink" href="#confval-osd_pool_default_flag_nodelete" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>在新存储池上设置 nodelete 标记。此标记可防止存储池被删除。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_flag_nopgchange">
<span class="sig-name descname"><span class="pre">osd_pool_default_flag_nopgchange</span></span><a class="headerlink" href="#confval-osd_pool_default_flag_nopgchange" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>在新存储池上设置 nopgchange 标记。不允许更改此存储池的 PG 数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_flag_nosizechange">
<span class="sig-name descname"><span class="pre">osd_pool_default_flag_nosizechange</span></span><a class="headerlink" href="#confval-osd_pool_default_flag_nosizechange" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>在新存储池上设置 nosizechange 标记。不允许更改此存储池的 <code class="docutils literal notranslate"><span class="pre">size</span></code> 。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<p>关于存储池标记详情请看<a class="reference internal" href="../../operations/pools/#setpoolvalues"><span class="std std-ref">存储池标记值</span></a>。</p>
</section>
<section id="id17">
<h2>杂项<a class="headerlink" href="#id17" title="Permalink to this heading"></a></h2>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_max_osd">
<span class="sig-name descname"><span class="pre">mon_max_osd</span></span><a class="headerlink" href="#confval-mon_max_osd" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>集群允许的最大 OSD 数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10000</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_globalid_prealloc">
<span class="sig-name descname"><span class="pre">mon_globalid_prealloc</span></span><a class="headerlink" href="#confval-mon_globalid_prealloc" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>为集群内的客户端和守护进程们预分配的全局 ID 数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10000</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_subscribe_interval">
<span class="sig-name descname"><span class="pre">mon_subscribe_interval</span></span><a class="headerlink" href="#confval-mon_subscribe_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>订阅内容的刷新间隔（秒）， 通过订阅机制可以获取集群运行图和日志信息。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span> <span class="pre">day</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_stat_smooth_intervals">
<span class="sig-name descname"><span class="pre">mon_stat_smooth_intervals</span></span><a class="headerlink" href="#confval-mon_stat_smooth_intervals" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Ceph 将平滑最后 <code class="docutils literal notranslate"><span class="pre">N</span></code> 个归置组图的统计信息。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">6</span></code></p>
</dd>
<dt class="field-odd">min<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_probe_timeout">
<span class="sig-name descname"><span class="pre">mon_probe_timeout</span></span><a class="headerlink" href="#confval-mon_probe_timeout" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器自举前等待的时间，等着发现互联节点。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">2.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_daemon_bytes">
<span class="sig-name descname"><span class="pre">mon_daemon_bytes</span></span><a class="headerlink" href="#confval-mon_daemon_bytes" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>给元数据服务器和 OSD 的消息使用的内存空间（字节）。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">400Mi</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_max_log_entries_per_event">
<span class="sig-name descname"><span class="pre">mon_max_log_entries_per_event</span></span><a class="headerlink" href="#confval-mon_max_log_entries_per_event" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>每个事件允许的最大日志条数。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">4096</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_osd_prime_pg_temp">
<span class="sig-name descname"><span class="pre">mon_osd_prime_pg_temp</span></span><a class="headerlink" href="#confval-mon_osd_prime_pg_temp" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>当一个先前处于 out 状态的 OSD 回到集群时， 捡回（prime ）还是不捡回包含先前各 OSD 的 PGMap 。 设置为
<code class="docutils literal notranslate"><span class="pre">true</span></code> 时，客户端们会继续使用先前的 OSD 们， 直到 PG 的新增 OSD 完成互联。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_osd_prime_pg_temp_max_time">
<span class="sig-name descname"><span class="pre">mon_osd_prime_pg_temp_max_time</span></span><a class="headerlink" href="#confval-mon_osd_prime_pg_temp_max_time" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>当某一个先前状态为 out 的 OSD 回到集群、 监视器在捡回 PGMap 时尝试的最大时间，单位为秒。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.5</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_osd_prime_pg_temp_max_estimate">
<span class="sig-name descname"><span class="pre">mon_osd_prime_pg_temp_max_estimate</span></span><a class="headerlink" href="#confval-mon_osd_prime_pg_temp_max_estimate" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Maximum estimate of time spent on each PG before we prime all PGs in
parallel.</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.25</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_mds_skip_sanity">
<span class="sig-name descname"><span class="pre">mon_mds_skip_sanity</span></span><a class="headerlink" href="#confval-mon_mds_skip_sanity" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>跳过 FSMap 的安全性检查确认（遇到软件缺陷时还想继续）。 如果 FSMap 健全性检查失败，监视器会终止，
但我们可以禁止检查，启用此选项即可。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_max_mdsmap_epochs">
<span class="sig-name descname"><span class="pre">mon_max_mdsmap_epochs</span></span><a class="headerlink" href="#confval-mon_max_mdsmap_epochs" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>一次提议最多可清理多少 mdsmap 时间结。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">500</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_config_key_max_entry_size">
<span class="sig-name descname"><span class="pre">mon_config_key_max_entry_size</span></span><a class="headerlink" href="#confval-mon_config_key_max_entry_size" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>config-key 条目的最大尺寸，单位为字节。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">64Ki</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_scrub_interval">
<span class="sig-name descname"><span class="pre">mon_scrub_interval</span></span><a class="headerlink" href="#confval-mon_scrub_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器洗刷其存储内容的频率， 会对比存储的校验和与根据所有存储的键计算出的校验和。 （ 0 禁用洗刷，很危险。慎用！）</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">secs</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span> <span class="pre">day</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_scrub_max_keys">
<span class="sig-name descname"><span class="pre">mon_scrub_max_keys</span></span><a class="headerlink" href="#confval-mon_scrub_max_keys" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>每次最多洗刷多少个键。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">100</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_compact_on_start">
<span class="sig-name descname"><span class="pre">mon_compact_on_start</span></span><a class="headerlink" href="#confval-mon_compact_on_start" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p><code class="docutils literal notranslate"><span class="pre">ceph-mon</span></code> 启动时压缩监视器存储所用的数据库。
如果常规压缩失效，可以执行手动压缩，
有助于缩小监视器的数据库、并提升其性能。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_compact_on_bootstrap">
<span class="sig-name descname"><span class="pre">mon_compact_on_bootstrap</span></span><a class="headerlink" href="#confval-mon_compact_on_bootstrap" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>自举引导期间压缩监视器所用的数据库。 监视器完成自举引导后开始互相探测，以建立法定人数； 如果一个监视器加入法定人数超时，
它会再次从头开始自举引导。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_compact_on_trim">
<span class="sig-name descname"><span class="pre">mon_compact_on_trim</span></span><a class="headerlink" href="#confval-mon_compact_on_trim" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>清理旧的状态存档时也压缩这个前缀（包括 paxos ）。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_cpu_threads">
<span class="sig-name descname"><span class="pre">mon_cpu_threads</span></span><a class="headerlink" href="#confval-mon_cpu_threads" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>监视器执行 CPU 密集型工作时使用的线程数。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">4</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_osd_mapping_pgs_per_chunk">
<span class="sig-name descname"><span class="pre">mon_osd_mapping_pgs_per_chunk</span></span><a class="headerlink" href="#confval-mon_osd_mapping_pgs_per_chunk" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>我们按块计算归置组到 OSD 的映射关系。 这个选项指定了每个块的归置组数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">4096</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_session_timeout">
<span class="sig-name descname"><span class="pre">mon_session_timeout</span></span><a class="headerlink" href="#confval-mon_session_timeout" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>会话闲置时间超过此时限， 监视器就会终结这个不活跃的会话。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span> <span class="pre">minutes</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_osd_cache_size_min">
<span class="sig-name descname"><span class="pre">mon_osd_cache_size_min</span></span><a class="headerlink" href="#confval-mon_osd_cache_size_min" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>The minimum amount of bytes to be kept mapped in memory for osd
monitor caches.</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">128Mi</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_memory_target">
<span class="sig-name descname"><span class="pre">mon_memory_target</span></span><a class="headerlink" href="#confval-mon_memory_target" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>The amount of bytes pertaining to OSD monitor caches and KV cache to
be kept mapped in memory with cache auto-tuning enabled.</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">2Gi</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_memory_autotune">
<span class="sig-name descname"><span class="pre">mon_memory_autotune</span></span><a class="headerlink" href="#confval-mon_memory_autotune" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Autotune the cache memory used for OSD monitors and KV database.</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../auth-config-ref/" class="btn btn-neutral float-left" title="Cephx 配置参考" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../mon-lookup-dns/" class="btn btn-neutral float-right" title="通过 DNS 查询监视器" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>